]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
network: Use NMDevice.get_available_connections(); for NMWirelessDialog
authorJasper St. Pierre <jstpierre@mecheye.net>
Thu, 23 Jan 2014 21:02:19 +0000 (16:02 -0500)
committerJasper St. Pierre <jstpierre@mecheye.net>
Thu, 23 Jan 2014 21:02:19 +0000 (16:02 -0500)
It's a lot simpler and doesn't require us routing the NMRemoteSettings
all the way through. It's still a bit complicated to do this for the
usual connections, so let's drop it for now.

js/ui/status/network.js

index 489d5335ab6c68eb791fe48b7ac124057dad7ef1..25c352bc61a452e4b67000eb8f0b84f9f47caf32 100644 (file)
@@ -609,7 +609,7 @@ const NMWirelessDialog = new Lang.Class({
     Name: 'NMWirelessDialog',
     Extends: ModalDialog.ModalDialog,
 
-    _init: function(client, device, settings) {
+    _init: function(client, device) {
         this.parent({ styleClass: 'nm-dialog' });
 
         this._client = client;
@@ -618,10 +618,7 @@ const NMWirelessDialog = new Lang.Class({
         this._networks = [];
         this._buildLayout();
 
-        let connections = settings.list_connections();
-        this._connections = connections.filter(Lang.bind(this, function(connection) {
-            return device.connection_valid(connection);
-        }));
+        this._connections = device.get_available_connections();
 
         this._apAddedId = device.connect('access-point-added', Lang.bind(this, this._accessPointAdded));
         this._apRemovedId = device.connect('access-point-removed', Lang.bind(this, this._accessPointRemoved));
@@ -971,10 +968,9 @@ const NMDeviceWireless = new Lang.Class({
     Name: 'NMDeviceWireless',
     category: NMConnectionCategory.WIRELESS,
 
-    _init: function(client, device, settings) {
+    _init: function(client, device) {
         this._client = client;
         this._device = device;
-        this._settings = settings;
 
         this._description = '';
 
@@ -1042,7 +1038,7 @@ const NMDeviceWireless = new Lang.Class({
     },
 
     _showDialog: function() {
-        this._dialog = new NMWirelessDialog(this._client, this._device, this._settings);
+        this._dialog = new NMWirelessDialog(this._client, this._device);
         this._dialog.connect('closed', Lang.bind(this, this._dialogClosed));
         this._dialog.open();
     },